#include<stdio.h>
int main(){
	int n = 0;
	int i = 0;
	int min = 0; 
	int num = 0; 
	scanf("%d\n",&n);
	scanf("%d ",&min);
	for(i=2;i<=n;i++){
		scanf("%d",&num);
		if(num<min){
			min = num; 
		} 	
	}
	printf("%d",min);
	
}
